/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package EntityBeans;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Keith Augustsson
 */
@Embeddable
public class UsesPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "airline")
    private String airline;
    @Basic(optional = false)
    @Column(name = "aircraft")
    private String aircraft;

    public UsesPK(String airline, String aircraft) {
        this.airline = airline;
        this.aircraft = aircraft;
    }

    public String getAirline() {
        return airline;
    }

    public void setAirline(String airline) {
        this.airline = airline;
    }

    public String getAircraft() {
        return aircraft;
    }

    public void setAircraft(String aircraft) {
        this.aircraft = aircraft;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (airline != null ? airline.hashCode() : 0);
        hash += (aircraft != null ? aircraft.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof UsesPK)) {
            return false;
        }
        UsesPK other = (UsesPK) object;
        if ((this.airline == null && other.airline != null) || (this.airline != null && !this.airline.equals(other.airline))) {
            return false;
        }
        if ((this.aircraft == null && other.aircraft != null) || (this.aircraft != null && !this.aircraft.equals(other.aircraft))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "EntityBeans.UsesPK[airline=" + airline + ", aircraft=" + aircraft + "]";
    }

}
